package com.itheima.homework;

public class Test05 {
    public static void main(String[] args) {
        Square sq = new Square(5);
        System.out.println("周长:"+sq.getPerimeter());
        System.out.println("面积:"+sq.getArea());


    }


}


class Square{
    private double side;

    public double getSide() {
        return side;
    }

    public void setSide(double side) {
        this.side = side;
    }

    public Square() {
    }

    public Square(double side) {
        this.side = side;
    }

    public double getPerimeter(){
       double perimeter = side*4;
       return perimeter;
    }

    public double getArea(){
        double area = side*side;
        return area;

    }
}